home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / FLDPAK.ZIP / FPDEMO2R.FRM < prev    next >
Text File  |  1994-02-02  |  15KB  |  501 lines

  1. VERSION 2.00
  2. Begin Form ReportFrm 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "FieldPack demo program 2 -- Report Set-up"
  5.    ClientHeight    =   2625
  6.    ClientLeft      =   1215
  7.    ClientTop       =   1890
  8.    ClientWidth     =   7470
  9.    ControlBox      =   0   'False
  10.    FontBold        =   -1  'True
  11.    FontItalic      =   0   'False
  12.    FontName        =   "Symbol"
  13.    FontSize        =   9.75
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   3030
  17.    Left            =   1155
  18.    LinkMode        =   1  'Source
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   2625
  23.    ScaleWidth      =   7470
  24.    Top             =   1545
  25.    Width           =   7590
  26.    Begin CommandButton cmdPreview 
  27.       Caption         =   "Preview"
  28.       Height          =   315
  29.       Left            =   6420
  30.       TabIndex        =   16
  31.       Top             =   900
  32.       Width           =   855
  33.    End
  34.    Begin CommandButton cmdWider 
  35.       Caption         =   "+"
  36.       Height          =   315
  37.       Left            =   4860
  38.       TabIndex        =   11
  39.       Top             =   1920
  40.       Width           =   315
  41.    End
  42.    Begin CommandButton cmdNarrower 
  43.       Caption         =   "-"
  44.       Height          =   315
  45.       Left            =   5220
  46.       TabIndex        =   10
  47.       Top             =   1920
  48.       Width           =   315
  49.    End
  50.    Begin CommandButton cmdCancel 
  51.       Caption         =   "Cancel"
  52.       Height          =   315
  53.       Left            =   6420
  54.       TabIndex        =   5
  55.       Top             =   1920
  56.       Width           =   855
  57.    End
  58.    Begin CommandButton cmdPrint 
  59.       Caption         =   "Print"
  60.       Height          =   315
  61.       Left            =   6420
  62.       TabIndex        =   4
  63.       Top             =   1410
  64.       Width           =   855
  65.    End
  66.    Begin CommandButton cmdMoveDown 
  67.       Caption         =   "Dn"
  68.       Height          =   315
  69.       Left            =   5700
  70.       TabIndex        =   9
  71.       Top             =   1170
  72.       Width           =   375
  73.    End
  74.    Begin CommandButton cmdDeselectField 
  75.       Caption         =   "<--"
  76.       Height          =   315
  77.       Left            =   2460
  78.       TabIndex        =   3
  79.       Top             =   1200
  80.       Width           =   675
  81.    End
  82.    Begin CommandButton cmdSelectField 
  83.       Caption         =   "-->"
  84.       Height          =   315
  85.       Left            =   2460
  86.       TabIndex        =   2
  87.       Top             =   720
  88.       Width           =   675
  89.    End
  90.    Begin CommandButton cmdMoveUp 
  91.       Caption         =   "Up"
  92.       Height          =   315
  93.       Left            =   5700
  94.       TabIndex        =   8
  95.       Top             =   750
  96.       Width           =   375
  97.    End
  98.    Begin ListBox lstSelectedFields 
  99.       Height          =   1395
  100.       Left            =   3360
  101.       TabIndex        =   1
  102.       Top             =   420
  103.       Width           =   2175
  104.    End
  105.    Begin ListBox lstAvailableFields 
  106.       Height          =   1395
  107.       Left            =   120
  108.       TabIndex        =   0
  109.       Top             =   420
  110.       Width           =   2115
  111.    End
  112.    Begin Label lblTotalWidth 
  113.       Alignment       =   1  'Right Justify
  114.       Caption         =   "0"
  115.       Height          =   195
  116.       Left            =   4440
  117.       TabIndex        =   15
  118.       Top             =   2280
  119.       Width           =   375
  120.    End
  121.    Begin Label lblFieldWidth 
  122.       Alignment       =   1  'Right Justify
  123.       Caption         =   "0"
  124.       Height          =   195
  125.       Left            =   4440
  126.       TabIndex        =   14
  127.       Top             =   1980
  128.       Width           =   375
  129.    End
  130.    Begin Label Label4 
  131.       Alignment       =   1  'Right Justify
  132.       Caption         =   "Total width:"
  133.       Height          =   195
  134.       Left            =   3240
  135.       TabIndex        =   13
  136.       Top             =   2280
  137.       Width           =   1155
  138.    End
  139.    Begin Label Label3 
  140.       Alignment       =   1  'Right Justify
  141.       Caption         =   "Field width:"
  142.       Height          =   195
  143.       Left            =   3240
  144.       TabIndex        =   12
  145.       Top             =   1980
  146.       Width           =   1155
  147.    End
  148.    Begin Label Label2 
  149.       Alignment       =   2  'Center
  150.       Caption         =   "Selected for report:"
  151.       Height          =   195
  152.       Left            =   3360
  153.       TabIndex        =   7
  154.       Top             =   120
  155.       Width           =   2145
  156.    End
  157.    Begin Label Label1 
  158.       Alignment       =   2  'Center
  159.       Caption         =   "Fields available:"
  160.       Height          =   195
  161.       Left            =   150
  162.       TabIndex        =   6
  163.       Top             =   120
  164.       Width           =   2085
  165.    End
  166. End
  167. Option Explicit
  168.  
  169. Sub cmdCancel_Click ()
  170.  
  171.     Unload ReportFrm
  172.  
  173. End Sub
  174.  
  175. Sub cmdDeselectField_Click ()
  176.     Dim i As Integer
  177.     Dim w As Integer
  178.  
  179.     If lstSelectedFields.ListIndex <> -1 Then
  180.         lstAvailableFields.AddItem lstSelectedFields.Text
  181.         w% = Val(DS_GetField((lstSelectedFields.Text), FldDlm$, 3))
  182.         If lstAvailableFields.ListCount = 1 Then
  183.             lstAvailableFields.ListIndex = 0
  184.         End If
  185.         i% = lstSelectedFields.ListIndex
  186.         lstSelectedFields.RemoveItem lstSelectedFields.ListIndex
  187.         If lstSelectedFields.ListCount > 0 Then
  188.             If i% >= lstSelectedFields.ListCount Then
  189.                 i% = lstSelectedFields.ListCount - 1
  190.             End If
  191.             lstSelectedFields.ListIndex = i%
  192.             lblTotalWidth.Caption = Format$(Val(lblTotalWidth.Caption) - w% - 1)
  193.         Else
  194.             lblFieldWidth.Caption = "0"
  195.             lblTotalWidth.Caption = "0"
  196.         End If
  197.     End If
  198.  
  199. End Sub
  200.  
  201. Sub cmdMoveDown_Click ()
  202.     Dim i As Integer
  203.     Dim temp As String
  204.  
  205.     If lstSelectedFields.ListIndex <> -1 Then
  206.         If lstSelectedFields.ListIndex < lstSelectedFields.ListCount - 1 Then
  207.             i% = lstSelectedFields.ListIndex
  208.             temp$ = lstSelectedFields.List(i%)
  209.             lstSelectedFields.RemoveItem i%
  210.             lstSelectedFields.AddItem temp$, i% + 1
  211.             lstSelectedFields.ListIndex = i% + 1
  212.         End If
  213.     End If
  214.  
  215. End Sub
  216.  
  217. Sub cmdMoveUp_Click ()
  218.     Dim i    As Integer
  219.     Dim temp As String
  220.  
  221.     If lstSelectedFields.ListIndex <> -1 Then
  222.         If lstSelectedFields.ListIndex > 0 Then
  223.             i% = lstSelectedFields.ListIndex
  224.             temp$ = lstSelectedFields.List(i%)
  225.             lstSelectedFields.RemoveItem i%
  226.             lstSelectedFields.AddItem temp$, i% - 1
  227.             lstSelectedFields.ListIndex = i% - 1
  228.         End If
  229.     End If
  230.  
  231. End Sub
  232.  
  233. Sub cmdNarrower_Click ()
  234.     Dim w As Integer
  235.     
  236.     If lstSelectedFields.ListCount > 0 Then
  237.         w% = Val(lblFieldWidth.Caption)
  238.         If w% > 0 Then
  239.             lblFieldWidth.Caption = Str$(w% - 1)
  240.             lblTotalWidth.Caption = Format$(Val(lblTotalWidth.Caption) - 1)
  241.             lstSelectedFields.List(lstSelectedFields.ListIndex) = DS_PutField((lstSelectedFields.List(lstSelectedFields.ListIndex)), FldDlm$, 3, (lblFieldWidth.Caption))
  242.         End If
  243.     End If
  244.  
  245. End Sub
  246.  
  247. Sub cmdPreview_Click ()
  248.     Dim i As Integer
  249.     Dim t As String
  250.     
  251.     If lstSelectedFields.ListCount > 0 Then
  252.         pr_num_fields% = lstSelectedFields.ListCount
  253.         ReDim pr_fld_numbers(pr_num_fields% + 1)
  254.         ReDim pr_fld_widths(pr_num_fields% + 1)
  255.         For i% = 1 To pr_num_fields%
  256.             t$ = lstSelectedFields.List(i% - 1)
  257.             t$ = DS_ReplaceDlms(t$, String$(40, " "), "")   ' trim   ???
  258.             pr_fld_numbers(i%) = Val(DS_GetField(t$, FldDlm$, 2))
  259.             pr_fld_widths(i%) = Val(DS_GetField(t$, FldDlm$, 3))
  260.         Next i%
  261.     End If
  262.  
  263.     preview_report
  264.     
  265. End Sub
  266.  
  267. Sub cmdPrint_Click ()
  268.     Dim i As Integer
  269.     Dim t As String
  270.     
  271.     If lstSelectedFields.ListCount > 0 Then
  272.         pr_num_fields% = lstSelectedFields.ListCount